var app = getApp();
Page({
  data: {
    
  },
  onLoad: function (e) {
    var that = this;
    if(e){
      var mid = decodeURIComponent(e.scene)
      that.setData({
        mid: mid
      })
      console.log(that.data.mid);
    }
  },
  onShow:function(){
    var that = this;
    var mid = that.data.mid;
    if (!app.globalData.plumSession) {
      console.log("暂未获取到session");
      app.globalData.requestQueue.push({
        page: app,
        fname: 'requestdistributionInfo',
        extra: mid
      });
    } else {
      console.log("已获取到session");
      if (mid){
        that.requestdistributionInfo(mid);
      }
    }
  },
	requestdistributionInfo: function (mid) {
		var that = this;
		var data = {};
		data.map = 'applet_three_set_level_new';
		data.mid = mid;
    console.log(data);
		//发起请求，获取列表列表
		wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: app.globalData.requestUrl,
      data: data,
      success: function (res) {
        console.log(res.data);
        if (res.data.ec == 200) {
          // that.setData({
          //   distributionInfo: res.data.data
          // })
          // console.log(that.data.distributionInfo);
          // app.errorTip(that, res.data.data.tip, 2000);
          app.backHome();
        } else {
          // app.errorTip(that, res.data.em, 2000);
        }
      },
      complete: function () {
        wx.hideLoading();
        wx.stopPullDownRefresh();
      }
    });
	},
	backSy:function(){
		app.backHome();
	}
})